maintainer="Michał Polański <michal@polanski.me>"
pkgname=warp-s3
pkgver=1.0.5
pkgrel=0
pkgdesc="Benchmarking tool for S3"
url="https://github.com/minio/warp"
license="AGPL-3.0"
arch="all !armhf !armv7 !x86" # tests fail on 32-bit architectures
makedepends="go"
options="net"
source="https://github.com/minio/warp/archive/v$pkgver/warp-s3-$pkgver.tar.gz"
builddir="$srcdir/warp-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags "-X github.com/minio/warp/pkg.Version=$pkgver" \
		-o warp-s3
}

check() {
	go test ./...
}

package() {
	install -Dm755 $pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
8cbe2ba8d067fde5ba28c2b0f3dcc926062ac1b90523e4a2f0bed06cff712be3475a974160bd7c5d98c7f487ceaade202b4206fa6f172d25f74486f8cc625208  warp-s3-1.0.5.tar.gz
"
